package com.pignest.hotel.beans;

import java.util.Date;

import org.directwebremoting.annotations.RemoteProperty;

import com.pignest.hotel.annotation.Bean;
import com.pignest.hotel.beans.global.BaseBean;

/**
 * TbCloseAccounts entity.
 * 
 * @author MyEclipse Persistence Tools
 */

@Bean("结账")
public class TbCloseAccounts extends BaseBean {
	private static final long serialVersionUID = 6573928588247351268L;
	
	private Living living;
	private Date time;
	private String type;//结账类型
	private int accounts;
	private int needAccounts;//系统提示需要收款
	private String username;
	private String userId;
	private int invoice;
	private String orderNo;//以入住时间为单据编号格式yyyyMMddHHmmss
	/**结账产生的序列号
	 * 如果是联房则跟入住记录的serialNumber一致
	 * 不是联房则为空
	 */
	private String serialNumber;
	/**现金结账：与orderNo一样
	 * 会员结账:会员卡号
	 * 银行卡、信用卡的则需要结账凭证单号
	 * */
	private String checkOutNo;
	

	// Constructors

	public String getCheckOutNo() {
		return checkOutNo;
	}

	public void setCheckOutNo(String checkOutNo) {
		this.checkOutNo = checkOutNo;
	}

	/** default constructor */
	public TbCloseAccounts() {
	}

	/** full constructor */
	public TbCloseAccounts(Living living, Date time, String type,
			int accounts, String username, String userId, int invoice,
			String orderNo,String serialNumber,String checkOutNo,int needAccounts) {
		this.living = living;
		this.time = time;
		this.type = type;
		this.accounts = accounts;
		this.username = username;
		this.userId = userId;
		this.invoice = invoice;
		this.orderNo=orderNo;
		this.serialNumber=serialNumber;
		this.checkOutNo=checkOutNo;
		this.needAccounts=needAccounts;
	}

	public Living getLiving() {
		return living;
	}

	public void setLiving(Living living) {
		this.living = living;
	}

	public Date getTime() {
		return this.time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public int getAccounts() {
		return this.accounts;
	}

	public void setAccounts(int accounts) {
		this.accounts = accounts;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public int getInvoice() {
		return this.invoice;
	}

	public void setInvoice(int invoice) {
		this.invoice = invoice;
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public String getSerialNumber() {
		return serialNumber;
	}

	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}

	public int getNeedAccounts() {
		return needAccounts;
	}

	public void setNeedAccounts(int needAccounts) {
		this.needAccounts = needAccounts;
	}
	@RemoteProperty
    public String getInvoice2()
    {
    	switch (invoice) {
		case 0:
			return "否";
		case 1:
			return "是";
		default:
			break;
		}
    	return "";
    }
	@Override
	public String toSimpleString() {
		return concat(living.getRoom().getName(), username, String.valueOf(accounts));
	}
}